package com.jysz.certificate.persistence.enums;
/**
 * 流程类型
 * @author xuxiaolong
 */
public enum WorkflowType {
	   
    ADD("补录", 0), UPDATE("修改", 1), RELEASE("释放", 2),SECOND("二网",3), RENEW("换证", 4), ADDLIST("批量补录", 5);   
   
    //名称
    private String name;
    //索引
    private int index;   
    private WorkflowType(String name, int index) {   
        this.name = name;   
        this.index = index;   
    }   
    
    //根据索引获得名称
    public static String getName(int index) {   
        for (WorkflowType w : WorkflowType.values()) {   
            if (w.getIndex() == index) {   
                return w.name;   
            }   
        }   
        return null;   
    }
    
    //根据索引获得枚举
    public static WorkflowType index(int index) {   
    	for (WorkflowType w : WorkflowType.values()) {   
    		if (w.getIndex() == index) {   
    			return w;   
    		}   
    	}   
    	return null;   
    }
    
    public String getName() {   
        return name;   
    }   
    public void setName(String name) {   
        this.name = name;   
    }   
    public int getIndex() {   
        return index;   
    }   
    public void setIndex(int index) {   
        this.index = index;   
    }   

}
